<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QXmlItem Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QXmlItem Class Reference<br /><sup><sup>[<a href="qtxmlpatterns.html">QtXmlPatterns</a> module]</sup></sup></h1><p>The QXmlItem class contains either an XML node or an atomic
value. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qxmlitem.html#QXmlItem">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qxmlitem.html#QXmlItem-2">__init__</a></b> (<i>self</i>, QXmlItem&#160;<i>other</i>)</li><li><div class="fn" /><b><a href="qxmlitem.html#QXmlItem-3">__init__</a></b> (<i>self</i>, QXmlNodeModelIndex&#160;<i>node</i>)</li><li><div class="fn" /><b><a href="qxmlitem.html#QXmlItem-4">__init__</a></b> (<i>self</i>, QVariant&#160;<i>atomicValue</i>)</li><li><div class="fn" />bool <b><a href="qxmlitem.html#isAtomicValue">isAtomicValue</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qxmlitem.html#isNode">isNode</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qxmlitem.html#isNull">isNull</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qxmlitem.html#toAtomicValue">toAtomicValue</a></b> (<i>self</i>)</li><li><div class="fn" />QXmlNodeModelIndex <b><a href="qxmlitem.html#toNodeModelIndex">toNodeModelIndex</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QXmlItem class contains either an XML node or an atomic
value.</p>
<p>In <a href="xmlprocessing.html">XQuery</a>, all expressions
evaluate to a sequence of items, where each item is either an XML
node or an atomic value. The query in the following snippet
evaluates to sequence of five items.</p>
<pre class="cpp">
 &lt;aNode/&gt;,
 xs:base64Binary("FFFF"),
 current-date(),
 3e3, (: A floating point value :)
 attribute {"name"} {()}
</pre>
<p>The five items are: An element, an atomic value (binary data
encoded in base64), a date, a float, and an attribute.</p>
<p>QXmlItem is the class that represents these <a href="xmlprocessing.html">XQuery</a> items in the <a href="qtxmlpatterns.html">QtXmlPatterns</a> API. A non-null instance of
QXmlItem is either a node or an atomic value. Calling <a href="qxmlitem.html#isNode">isNode</a>() or <a href="qxmlitem.html#isAtomicValue">isAtomicValue</a>() tells you which
it is. Atomic values are represented elsewhere in the Qt API as
instances of <a href="qvariant.html">QVariant</a>, and an instance
of QXmlItem that represents an atomic value can be converted to a
<a href="qvariant.html">QVariant</a> by calling <a href="qxmlitem.html#toAtomicValue">toAtomicValue</a>(). A QXmlItem that
wraps a node is represented elsewhere as an instance of <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a>. A node QXmlItem
can be converted to a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> by calling
<a href="qxmlitem.html#toNodeModelIndex">toNodeModelIndex</a>().</p>
<p>A default constructed QXmlItem instance is neither a node nor an
atomic value. It is considered null, in which case <a href="qxmlitem.html#isNull">isNull</a>() returns true.</p>
<p>An instance of QXmlItem will be left dangling if the <a href="qabstractxmlnodemodel.html">XML node model</a> it refers to is
deleted, if it is a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QXmlItem" />QXmlItem.__init__ (<i>self</i>)</h3><p>Constructs a null <a href="qxmlitem.html">QXmlItem</a> that is
neither a node nor an atomic value. <a href="qxmlitem.html#isNull">isNull</a>() returns true for a default
constructed instance.</p>


<h3 class="fn"><a name="QXmlItem-2" />QXmlItem.__init__ (<i>self</i>, <a href="qxmlitem.html">QXmlItem</a>&#160;<i>other</i>)</h3><p>The copy constructor constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="QXmlItem-3" />QXmlItem.__init__ (<i>self</i>, <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a>&#160;<i>node</i>)</h3><p>Constructs a node <a href="qxmlitem.html">QXmlItem</a> that is a
copy of <i>node</i>.</p>
<p><b>See also</b> <a href="qxmlitem.html#isNode">isNode</a>().</p>


<h3 class="fn"><a name="QXmlItem-4" />QXmlItem.__init__ (<i>self</i>, QVariant&#160;<i>atomicValue</i>)</h3><p>Constructs an atomic value <a href="qxmlitem.html">QXmlItem</a>
with <i>atomicValue</i>.</p>
<p><b>See also</b> <a href="qxmlitem.html#isAtomicValue">isAtomicValue</a>().</p>


<h3 class="fn"><a name="isAtomicValue" />bool QXmlItem.isAtomicValue (<i>self</i>)</h3><p>Returns true if this item is an atomic value. Returns false if
it is a node or null.</p>
<p><b>See also</b> <a href="qxmlitem.html#isNull">isNull</a>() and
<a href="qxmlitem.html#isNode">isNode</a>().</p>


<h3 class="fn"><a name="isNode" />bool QXmlItem.isNode (<i>self</i>)</h3><p>Returns true if this item is a Node. Returns false if it is an
atomic value or null.</p>
<p><b>See also</b> <a href="qxmlitem.html#isNull">isNull</a>() and
<a href="qxmlitem.html#isAtomicValue">isAtomicValue</a>().</p>


<h3 class="fn"><a name="isNull" />bool QXmlItem.isNull (<i>self</i>)</h3><p>Returns true if this <a href="qxmlitem.html">QXmlItem</a> is
neither a node nor an atomic value. Default constructed instances
of <a href="qxmlitem.html">QXmlItem</a> are null.</p>


<h3 class="fn"><a name="toAtomicValue" />QVariant QXmlItem.toAtomicValue (<i>self</i>)</h3><p>If this <a href="qxmlitem.html">QXmlItem</a> represents an
atomic value, it is converted to an appropriate <a href="qvariant.html">QVariant</a> and returned. If this <a href="qxmlitem.html">QXmlItem</a> is not an atomic value, the return
value is a default constructed <a href="qvariant.html">QVariant</a>. You can call <a href="qxmlitem.html#isAtomicValue">isAtomicValue</a>() to test whether
the item is an atomic value.</p>
<p><b>See also</b> <a href="qxmlitem.html#isAtomicValue">isAtomicValue</a>().</p>


<h3 class="fn"><a name="toNodeModelIndex" /><a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a> QXmlItem.toNodeModelIndex (<i>self</i>)</h3><p>If this <a href="qxmlitem.html">QXmlItem</a> represents a node,
it returns the item as a <a href="qxmlnodemodelindex.html">QXmlNodeModelIndex</a>. If this <a href="qxmlitem.html">QXmlItem</a> is not a node, the return value is
undefined. You can call <a href="qxmlitem.html#isNode">isNode</a>()
to test whether the item is a node.</p>
<p><b>See also</b> <a href="qxmlitem.html#isNode">isNode</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>